import request from '@/utils/request'

// 通知相关API
export const notificationApi = {
  // 获取通知列表
  getNotifications: (params) => {
    return request({
      url: '/api/notifications',
      method: 'GET',
      params
    })
  },
  
  // 获取未读通知数量
  getUnreadCount: () => {
    return request({
      url: '/api/notifications/unread-count',
      method: 'GET'
    })
  },
  
  // 标记通知为已读
  markAsRead: (notificationIds) => {
    return request({
      url: '/api/notifications/mark-read',
      method: 'PUT',
      data: { notificationIds }
    })
  },
  
  // 标记所有通知为已读
  markAllAsRead: () => {
    return request({
      url: '/api/notifications/mark-all-read',
      method: 'PUT'
    })
  },
  
  // 删除通知
  deleteNotification: (notificationId) => {
    return request({
      url: `/api/notifications/${notificationId}`,
      method: 'DELETE'
    })
  },
  
  // 批量删除通知
  batchDeleteNotifications: (notificationIds) => {
    return request({
      url: '/api/notifications/batch-delete',
      method: 'DELETE',
      data: { notificationIds }
    })
  },
  
  // 清空所有通知
  clearAllNotifications: () => {
    return request({
      url: '/api/notifications/clear-all',
      method: 'DELETE'
    })
  }
}